import 'package:flutter_test/flutter_test.dart';
import 'package:sml_policies/sml_policies.dart';
import 'package:sml_policies/sml_policies_platform_interface.dart';
import 'package:sml_policies/sml_policies_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockSmlPoliciesPlatform
    with MockPlatformInterfaceMixin
    implements SmlPoliciesPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final SmlPoliciesPlatform initialPlatform = SmlPoliciesPlatform.instance;

  test('$MethodChannelSmlPolicies is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelSmlPolicies>());
  });

  test('getPlatformVersion', () async {
    SmlPolicies smlPoliciesPlugin = SmlPolicies();
    MockSmlPoliciesPlatform fakePlatform = MockSmlPoliciesPlatform();
    SmlPoliciesPlatform.instance = fakePlatform;

    expect(await smlPoliciesPlugin.getPlatformVersion(), '42');
  });
}
